{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>标题：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="标题" name="title" value="{$vo.title ?? ''}"  datatype="*" nullmsg="请填写标题">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>图片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="图片" name="img" value="{$vo.img ?? ''}"  datatype="*" nullmsg="请填写图片">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>跳转类型:</label>
            <div class="formControls col-xs-6 col-sm-6">
                <div class="select-box">
                    <select name="jump_type" class="select" datatype="*" nullmsg="请选择跳转类型:1跳转h5;2跳转内小程序;3:外部小程序">
                        <option hidden value="{$vo.jump_type ?? 0}">
                            {notempty name="vo.jump_type"}
                            {if condition="$vo.jump_type == 1"} 跳转h5
                            {/if}
                            {if condition="$vo.jump_type == 2"} 跳转内小程序
                            {/if}
                            {if condition="$vo.jump_type == 3"} 外部小程序
                            {/if}
                            {/notempty}

                        </option>

                        <option value="1">跳转h5</option>
                        <option value="2">跳转内小程序</option>
                        <option value="3">外部小程序</option>
                    </select>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">跳转的小程序appid：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="跳转的小程序appid" name="appid" value="{$vo.appid ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>跳转路径：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="跳转路径" name="url" value="{$vo.url ?? ''}"  datatype="*" nullmsg="请填写跳转路径">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">显示状态:0显示;1不显示：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <div class="select-box">
                    <select name="status" class="select" datatype="*" nullmsg="请选择显示状态:0显示;1不显示">
                        <option value="0">0</option>
                        <option value="1">1</option>
                    </select>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">显示权重(越大越靠前)：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="number" class="input-text" placeholder="显示权重(越大越靠前)" name="weight" value="{$vo.weight ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='status'][value='{$vo.status ?? ''}']").prop("checked", true);
        $("[name='jump_type']").find("[value='{$vo.jump_type ?? ''}']").attr("selected", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
